<?php
	$lp_root_path = './';
	$general_root_path = '../';

	define('INSIDE', true);
	include($general_root_path . 'extension.inc');
	include($general_root_path . 'common.'.$phpEx);
	if (!check_admin()){header('Location: index.'.$phpEx);	}
	include_once ($lp_root_path ."procedures.class.".$phpEx);
	//-------------------------------------------------------------------------
	if (isset($_REQUEST ['building_createPlanetBuildings']))
	{
	echo 'Probando building_createPlanetBuildings <br>';
	$planetId = $_POST['planetId'];
	Procedures::sp_building_createPlanetBuildings($planetId);
	}
	if (isset($_REQUEST ['hangar_createPlanetFleet']))
	{
	echo 'Probando hangar_createPlanetFleet<br>';
	$planetId = $_POST['planetId'];
	Procedures::sp_hangar_createPlanetFleet($planetId);
	}

	if (isset($_REQUEST ['planets_getFull']))
	{
	echo 'Probando sp_planets_getFull <br>';
	$planetId = $_POST['planetId'];
	$result = Procedures::sp_planets_getFull($planetId);
	 	while ($r = array_pop($result))
	{
	print "----".$r['crystalRatio']."<br>";
	}  

	}
	//-------------------------------------------------------------------------
	if (isset($_REQUEST ['planets_getFromUser']))
	{
	echo 'Probando planets_getFromUser <br>';
	$userId = $_POST['userId'];
	echo Procedures::sp_planets_getFromUser($userId);
	}
	//-------------------------------------------------------------------------
	if (isset($_REQUEST ['planets_setUser']))
	{
	echo 'Probando planets_getFromUser <br>';
	$userId = $_POST['userId'];
	$planetId = $_POST['planetId'];
	Procedures::sp_planets_setUser($userId,$planetId);
	}

	if (isset($_REQUEST ['building_eventCancel']))
	{
	echo 'Probando building_eventCancel <br>';
	$name = $_POST['name'];
	$planetId = $_POST['planetId'];
	Procedures::sp_building_eventCancel($name,$planetId);
	}
	//-------------------------------------------------------------------------
	


	//-------------------------------------------------------------------------
	if (isset($_REQUEST ['return']))
	{
	header('Location: index.'.$phpEx);
	}
?>

<form name="login" action="test_procedures.php" method="post">
     	<INPUT TYPE="submit" name="return"  VALUE="<< Return" > 
</form>

